package com.fyzk.model;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import android.content.Context;

import com.umeng.analytics.MobclickAgent;

public class UMengTongJi_eventIds {

	/**
	 * 点击登录按钮（登录界面）
	 */
	private static final String LOGINONCLICK_ID = "LoginOnClick_id";
	/**
	 * 点击注册按钮（注册界面）
	 */
	private static final String REGISTRATIONONCLICK_ID = "RegistrationOnClick_id";
	/**
	 * 点击购买按钮（支付界面）
	 */
	private static final String BUYONCLICK_ID = "BuyOnClick_id";
	
	/**
	 * 购买彩票（支付界面）
	 */
	private static final String BUY_ID = "Buy_id";
	
	/**
	 * 登录统计
	 * @param context
	 * @param isSuccess		是否登录成功
	 * @param errorCode		登录失败的code
	 */
	public static void LoginOnClick(Context context, boolean isSuccess, String errorCode){
		Map<String, String> map = new HashMap<String, String>();
		map.put("isSuccess", ""+isSuccess);
		map.put("errorCode", ""+errorCode);
		
		MobclickAgent.onEvent(context, LOGINONCLICK_ID, map);
	}
	
	/**
	 * 注册统计
	 * @param context
	 */
	public static void RegistrationOnClick(Context context){
		MobclickAgent.onEvent(context, REGISTRATIONONCLICK_ID);
	}
	
	/**
	 * 点击支付按钮统计
	 * @param context
	 * 
	 */
	public static void BuyOnClick(Context context, String type, String lotteryId, String lotteryName){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		map.put("lotteryId", lotteryId);
		map.put("lotteryName", lotteryName);
		
		MobclickAgent.onEvent(context, BUYONCLICK_ID, map);
	}
	
	/**
	 * 购买彩票
	 * @param context
	 * @param lotteryId		彩种id
	 * @param lotteryId		彩种名称
	 * @param money			购买彩金
	 * @param isSuccess		是否成功
	 */
	public static void Buy(Context context, String type, String lotteryId, String lotteryName, BigDecimal money, boolean isSuccess){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		map.put("lotteryId", lotteryId);
		map.put("lotteryName", lotteryName);
		map.put("money", ""+money);
		map.put("isSuccess", ""+isSuccess);
		
		Map<String, String> map2 = new HashMap<String, String>();
		map2.put("money", ""+money);
		MobclickAgent.onEventValue(context, BUY_ID, map2, 0);
	}
	
	/**
	 * 购买彩票
	 * @param context
	 * @param lotteryId		彩种id
	 * @param lotteryId		彩种名称
	 * @param money			购买彩金
	 * @param isSuccess		是否成功
	 */
	public static void Buy(Context context, String type, String lotteryId, String lotteryName, int money, boolean isSuccess){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		map.put("lotteryId", lotteryId);
		map.put("lotteryName", lotteryName);
		map.put("money", ""+money);
		map.put("isSuccess", ""+isSuccess);
		
		Map<String, String> map2 = new HashMap<String, String>();
		map2.put("money", ""+money);
		MobclickAgent.onEventValue(context, BUY_ID, map2, 0);
	}
}
